package com.lmq.liskov.impro;

public class Liskov {
    public static void main(String[] args) {
        A a = new A();
        System.out.println("11-3 = " + a.func1(11,3));
        System.out.println("11-8 = "+ a.func1(11,8));

        System.out.println("-----------------");
        B b =  new B();
        System.out.println("11+3 = " + b.func1(11,3));
        System.out.println("11+8 = "+ b.func1(11,8));
        System.out.println("11+3+9 = "+ b.func2(11,3));

        System.out.println("11-3 = "+b.func3(11,3));




    }
}

//base class
class Base{

}

class A extends Base {
    public int func1(int num1, int num2){
        return num1-num2;
    }
}

class B extends Base{
    private A aclass  = new A();
    public int func1(int a, int b){
        return  a + b;
    }

    public int func2(int a, int b){
        return func1(a,b) + 9;
    }
    public  int func3(int a, int b){
        return aclass.func1(a,b);
    }
}

